package me.zhao.subscribe.jdkSubscribe;

import java.util.Observable;
import java.util.Observer;

/**
 * 具体的观察者对象
 * @author zhaoying
 *
 */
public class ConcreateObserver implements Observer {
	private String observerName;
	
	@Override
	public void update(Observable o, Object arg) {
		String content = ((ConcreateWeatherSubject)o).getWeatherConetent();
		System.out.println(observerName + "主动拉过来消息：" + content);
		
		System.out.println(observerName + "收到推过来过来消息：" + arg);
	}

	public String getObserverName() {
		return observerName;
	}

	public void setObserverName(String observerName) {
		this.observerName = observerName;
	}
}
